package dominio.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dominio.controlador.CtrlPrincipal;

public class Test extends HttpServlet {

	private static final long serialVersionUID = -6595002829881238577L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		CtrlPrincipal ctrlPrincipal = new CtrlPrincipal(request, response, getServletContext());
		
		request.setAttribute("ListaFilmesAssistidos", ctrlPrincipal.carregarListaFilmesPorRanking());
		request.setAttribute("ListaFilmesAssistidosPorData", ctrlPrincipal.carregarListaFilmesPorData());
		request.setAttribute("ListaFilmesAssistidosPorCriterio", ctrlPrincipal.carregarListaFilmesPorCriterio("Eagle", 2));
		
		String nextJSP = "/teste.jsp";
		RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP);
		dispatcher.forward(request,response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	}

}
